Query of main column causes DOORS crash

Hello altogether,

 

does anybody knows a reason why the main-column query in a view can cause a fatal DOORS crash?  (a Windows "DOORS will not work anymore" dialog and the question if I want to debug this application)

I'm writing a module synchronization script, which synchronizes the attributes and views of modules. Therefore the first step is to select a template module and then one or more target modules.

The GUI has a list view with checkboxes to select the used target modules. The stuff with the attributes works fine, so far.... But the views... They makes me crazy.

I've reduced the view synchronization code as much as possible and finally I ended with a complete standalone "test/debug" function within the complete script which will NOT use any variables of the main script.

The strange part is, that the following snippet works as requested when using it standalone (e.g. by using the "Edit DXL" dialog), but as soon as I call this "debug" function in my complete script, DOORS will crash WITHIN this function.

 

bool debug()
{
  if (null current Module) {print "current module: NULL\n"}
  else {print "current module: " (fullName(current Module)) "\n"}
  
  Column oColumn = null;
  string strViewName = null;
  bool bIsMain = false;
  Skip p_slTemplateViews = createString();

  Module m = read("/Development/ModuleSynch/Template", true);
  current = m;
  
  for strViewName in views(m) do
  {
    print "Saving '" strViewName "'...";
    if (put (p_slTemplateViews, strViewName, strViewName)) {print "OK\n"}
    else {print "FAILED\n"}
  }
    
  for strViewName in p_slTemplateViews do
  {
    print "Loading: '" strViewName "'....\n"
    if (!load(m, view(strViewName), false))
    {
      print "   View '" strViewName "' could NOT be loaded.\n"
    }
    else
    {
      print "   View '" strViewName "' loaded.\n"
      for oColumn in m do
      {
        print "      " (title(oColumn)) " is MAIN?: "
        bIsMain = main(oColumn);
        if (bIsMain) {print "TRUE"}
        else {print "FALSE"}
        
        print "\n"
      }
    }
  }
  
  delete p_slTemplateViews;
  return true;
}

debug()

 

 

When disabling the line:

bIsMain = main(oColumn);

the script works well, the title can be read and printed. I've also tested reading the width and so on... Everything works great, but when I do a query if the current column is the main column, DOORS will crash...

 

I tried setting the current module to the just opened (for reading) module, keep as null and and and... And now I've no more ideas what I can do anymore to find the reason for the crash....

Why can I read all information of each column in every view but not check if the current column is the main column?

Does anybody knows some "hidden" preconditions?

 

Best regards,

 

Michael


MichaelBrockhaus - Mon Nov 12 03:16:06 EST 2018

Re: Query of main column causes DOORS crash
MichaelBrockhaus - Tue Nov 13 08:57:26 EST 2018

Hello together,

 

okay, a couple of hours later I'm now much more confused... I've deleted almost 99% of my code and comments and have produced the simplest possible file (see attachment)...

I don't see any wrong program sequence or other problems, but executing this script will cause a DOORS crash.

Please, can anybody have a look into the file and tell me WHAT I'm doing wrong?

 

What I'm doing:

  • I start a new DOORS instance as a standard user with full access (RMCDA) to the specified template module (see line 22).
  • In the DOORS main window I go to the DXL-Editor (Tools-->Edit DXL) and paste to content of the attached file (there is currently no open module)
  • Press "Run" in the DXL-Editor window
  • CRASH

I really don't have any further ideas what to do...

 

Frustrated greetings,

 

Michael

 

 


Attachments

SynchronizeModuleStructure.dxl

Re: Query of main column causes DOORS crash
morast - Tue Nov 13 12:02:56 EST 2018

MichaelBrockhaus - Tue Nov 13 08:57:26 EST 2018

Hello together,

 

okay, a couple of hours later I'm now much more confused... I've deleted almost 99% of my code and comments and have produced the simplest possible file (see attachment)...

I don't see any wrong program sequence or other problems, but executing this script will cause a DOORS crash.

Please, can anybody have a look into the file and tell me WHAT I'm doing wrong?

 

What I'm doing:

  • I start a new DOORS instance as a standard user with full access (RMCDA) to the specified template module (see line 22).
  • In the DOORS main window I go to the DXL-Editor (Tools-->Edit DXL) and paste to content of the attached file (there is currently no open module)
  • Press "Run" in the DXL-Editor window
  • CRASH

I really don't have any further ideas what to do...

 

Frustrated greetings,

 

Michael

 

 

Well, remove 9 and 10 in your script:

void   DoTest(void);
void   main(void);

Line 10 defining a void function called main causes the trouble you have

Re: Query of main column causes DOORS crash
Mike.Scharnow - Tue Nov 13 12:20:20 EST 2018

rename your function "main" to something different. Apparently "void main()" conflicts with "bool main(Column)"

 

Edit: damned. too late :)

Re: Query of main column causes DOORS crash
MichaelBrockhaus - Wed Nov 14 00:56:58 EST 2018

Mike.Scharnow - Tue Nov 13 12:20:20 EST 2018

rename your function "main" to something different. Apparently "void main()" conflicts with "bool main(Column)"

 

Edit: damned. too late :)

OMG :-( That's the solution... Shame on me... Coming from the C/C++ world I have got accustomed to start all my scripts with a "main" function, not "realizing" that there can be a collision with the main function of columns, which is using a parameter (column) and not void (as "my" main)... Thank you very, very much, especially for the hint with the conflict.